package com.szis.auth.common;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * 服务管理
 *
 * @author: yxl
 * 2025-07-18
 */
public interface ServerManager {

    void set(ServerNodeInfo server);

    ServerNodeInfo get();

    List<ServerNodeInfo> listServers(String serverName);

    void register(ServerNodeInfo server);

    void unregister(ServerNodeInfo server);

    int workerId(String serverName, ServerNodeInfo server);

    @Data
    @AllArgsConstructor
    class ServerNodeInfo {
        private String serverName;
        private String host;
        private Integer port;
    }

}
